﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DragDraw
{
    public partial class LoadingControl : UserControl
    {
        private bool m_isShow = false;

        public LoadingControl()
        {
            InitializeComponent();
            Visibility = Visibility.Collapsed;
            AnimHide.Completed += new EventHandler(delegate(object sender, EventArgs e)
                { this.Visibility = Visibility.Collapsed; });
        }

        public bool Show
        {
            get { return m_isShow; }
            set
            {
                if (!m_isShow && value)
                {
                    Visibility = Visibility.Visible;
                }
                else if (m_isShow && !value)
                {
                    AnimHide.Begin();
                }
                m_isShow = value;
            }
        }
    }
}
